home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
dviware
/
quicspool
/
libqmsquery
/
qmspfp.y
< prev
next >
Wrap
Text File
|
1990-10-01
|
1KB
|
76 lines
%{
#ifndef lint
static char *rcs = "$Header: qmspfp.y,v 1.1 88/01/15 12:19:26 simpson Rel $";
#endif
/*
$Log: qmspfp.y,v $
* Revision 1.1 88/01/15 12:19:26 simpson
* initial release
*
* Revision 0.1 87/12/11 17:12:09 simpson
* beta test
*
*/
#include <stdio.h>
#include <setjmp.h>
#include <local/standard.h>
#include "qms.h"
extern FILE *_Ifp, *_Ofp;
extern Boolean _FirstChar;
static jmp_buf Env;
char *malloc();
static struct qmspfp *PfpList, *P;
%}
%token PFP NONE ENDLINE
%token <s> STRING
%union {
char s[81];
}
%%
pfplines : pfplines pfpline | pfpline ;
pfpline : PFP module ENDLINE ;
module :
NONE
{
PfpList = NULL;
}
|
STRING
{
P = (struct qmspfp *)malloc((unsigned)sizeof(struct qmspfp));
P->next = PfpList, PfpList = P;
(void)strcpy(P->module = malloc((unsigned)(strlen($1) + 1)), $1);
}
;
%%
#include "qmspfplex.c"
struct qmspfp *qmspfp()
{
_FirstChar = TRUE;
PfpList = NULL;
fputs(QUICON, _Ofp);
fprintf(_Ofp, "%s00000", SYNTAX);
fprintf(_Ofp, "%sPFP%s", INFO, ENDCMD);
fputs(QUICOFF, _Ofp);
(void)fflush(_Ofp);
if (setjmp(Env)) {
while (timedgetc(_Ifp) != EOF) /* Discard remaining input */
;
return NULL;
}
if (yyparse() != 0)
return NULL;
yysptr = yysbuf; /* Resets lex lookahead buffer */
return PfpList;
}
static yyerror(s)
char *s;
{
longjmp(Env, TRUE);
}